
<template tag="以下文档内容为hycli自动生成">
  <div>
   
    <!-- 关联需求 -->
    <el-dialog v-model="conf.aaaku_visible" 
      v-if="conf.aaaku_visible"   draggable
      title="关联需求" :close-on-click-modal="false"  width="60%"
      top="10vh" 
      :before-close="hide_aaaku">
    <el-form  ref="fm_aaaku" :model="form_aaaku" :rules="rules_aaaku">
    <el-row>
    </el-row>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="hide_aaaku" icon="close">取消</el-button>
        <el-button type="primary" @click="save_aaaku" icon="select">提交</el-button>
      </span>
    </template>
    </el-dialog>
   
    <!-- 计划时间 -->
    <el-dialog v-model="conf.aaabq_visible" 
        draggable
      title="计划时间" :close-on-click-modal="false"  width="60%"
      top="10vh" 
      :before-close="hide_aaabq">
    <el-form  ref="fm_aaabq" :model="form_aaabq" :rules="rules_aaabq">
    <el-row>
    <el-col :span="12">
    <!-- {"index":14,"raw":"pmstatus","name":"pmstatus","cname":"Pmstatus","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":false,"constraints":["c","l","le","q","u","v","w","sl","tp(multiselect,q)","fq","tp(radio,c-u-w-fx)","color","lw(80)","fx"],"desc":{"raw":"项目状态","name":"项目状态"}} -->
    <el-form-item prop="pmstatus" label="项目状态" label-width="100px" label-position="right">
      <el-radio-group v-model="form_aaabq.pmstatus"   >
        <el-radio-button v-for="item in pmstatusList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":15,"raw":"dstatus","name":"dstatus","cname":"Dstatus","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":false,"constraints":["c","l","le","u","v","w","sl","tp(radio,c-u-w-fx)","fq","tp(multiselect,q)","tp(tag)","color","fx"],"desc":{"raw":"研发状态","name":"研发状态"}} -->
    <el-form-item prop="dstatus" label="研发状态" label-width="100px" label-position="right">
      <el-radio-group v-model="form_aaabq.dstatus"   >
        <el-radio-button v-for="item in dstatusList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":19,"raw":"req_ass_time","name":"req_ass_time","cname":"ReqAssTime","type":{"raw":"date","name":"date","len":0,"dlen":0},"defValue":"","allowNull":true,"constraints":["c","le","u","v","x","y","q","f(MM/dd HH时)","tp(daterange)","tp(datetime,c-u-fx,yyyy/MM/dd 09:00:00)","tp(daterange,q)","fx"],"desc":{"raw":"需求评估","name":"需求评估"}} -->
    <!--需求评估 日期控件 -->
    <el-form-item prop="req_ass_time" label="需求评估" label-width="100px" label-position="right">
      <el-date-picker style="width: 100%" v-model="form_aaabq.req_ass_time" clearable type="datetime"
        placeholder="请选择需求评估" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" 
         :default-time="new Date($theia.str.dateFormat(new Date(),'yyyy/MM/dd 09:00:00'))"/>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":20,"raw":"tch_sol_ass_time","name":"tch_sol_ass_time","cname":"TchSolAssTime","type":{"raw":"date","name":"date","len":0,"dlen":0},"defValue":"","allowNull":true,"constraints":["c","le","u","v","x","q","f(MM/dd HH时)","tp(daterange)","tp(datetime,c-u-fx,yyyy/MM/dd 09:00:00)","fx"],"desc":{"raw":"方案评审","name":"方案评审"}} -->
    <!--方案评审 日期控件 -->
    <el-form-item prop="tch_sol_ass_time" label="方案评审" label-width="100px" label-position="right">
      <el-date-picker style="width: 100%" v-model="form_aaabq.tch_sol_ass_time" clearable type="datetime"
        placeholder="请选择方案评审" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" 
         :default-time="new Date($theia.str.dateFormat(new Date(),'yyyy/MM/dd 09:00:00'))"/>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":21,"raw":"test_case_time","name":"test_case_time","cname":"TestCaseTime","type":{"raw":"date","name":"date","len":0,"dlen":0},"defValue":"","allowNull":true,"constraints":["c","le","u","v","x","q","f(MM/dd HH时)","tp(daterange)","tp(datetime,c-u-fx,yyyy/MM/dd 09:00:00)","fx"],"desc":{"raw":"用例评审","name":"用例评审"}} -->
    <!--用例评审 日期控件 -->
    <el-form-item prop="test_case_time" label="用例评审" label-width="100px" label-position="right">
      <el-date-picker style="width: 100%" v-model="form_aaabq.test_case_time" clearable type="datetime"
        placeholder="请选择用例评审" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" 
         :default-time="new Date($theia.str.dateFormat(new Date(),'yyyy/MM/dd 09:00:00'))"/>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":22,"raw":"join_test_time","name":"join_test_time","cname":"JoinTestTime","type":{"raw":"date","name":"date","len":0,"dlen":0},"defValue":"","allowNull":true,"constraints":["c","le","u","v","x","q","f(MM/dd HH时)","tp(daterange)","tp(datetime,c-u-fx,yyyy/MM/dd 09:00:00)","fx"],"desc":{"raw":"联调开始","name":"联调开始"}} -->
    <!--联调开始 日期控件 -->
    <el-form-item prop="join_test_time" label="联调开始" label-width="100px" label-position="right">
      <el-date-picker style="width: 100%" v-model="form_aaabq.join_test_time" clearable type="datetime"
        placeholder="请选择联调开始" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" 
         :default-time="new Date($theia.str.dateFormat(new Date(),'yyyy/MM/dd 09:00:00'))"/>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":23,"raw":"checkin_test_time","name":"checkin_test_time","cname":"CheckinTestTime","type":{"raw":"date","name":"date","len":0,"dlen":0},"defValue":"","allowNull":true,"constraints":["l","c","le","u","v","x","q","f(MM/dd HH时)","tp(daterange)","tp(datetime,c-u-fx,yyyy/MM/dd 18:00:00)","show(m,l)","fx"],"desc":{"raw":"提测截止","name":"提测截止"}} -->
    <!--提测截止 日期控件 -->
    <el-form-item prop="checkin_test_time" label="提测截止" label-width="100px" label-position="right">
      <el-date-picker style="width: 100%" v-model="form_aaabq.checkin_test_time" clearable type="datetime"
        placeholder="请选择提测截止" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" 
         :default-time="new Date($theia.str.dateFormat(new Date(),'yyyy/MM/dd 18:00:00'))"/>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":24,"raw":"complete_test_time","name":"complete_test_time","cname":"CompleteTestTime","type":{"raw":"date","name":"date","len":0,"dlen":0},"defValue":"","allowNull":true,"constraints":["c","le","u","v","q","f(MM/dd HH时)","tp(daterange)","tp(datetime,c-u-fx,yyyy/MM/dd 18:00:00)","fx"],"desc":{"raw":"测试完成","name":"测试完成"}} -->
    <!--测试完成 日期控件 -->
    <el-form-item prop="complete_test_time" label="测试完成" label-width="100px" label-position="right">
      <el-date-picker style="width: 100%" v-model="form_aaabq.complete_test_time" clearable type="datetime"
        placeholder="请选择测试完成" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" 
         :default-time="new Date($theia.str.dateFormat(new Date(),'yyyy/MM/dd 18:00:00'))"/>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":25,"raw":"prod_deploy_time","name":"prod_deploy_time","cname":"ProdDeployTime","type":{"raw":"date","name":"date","len":0,"dlen":0},"defValue":"","allowNull":true,"constraints":["c","le","l","u","v","y","x","q","f(MM/dd HH时)","tp(datetime,c-u)","tp(daterange)","tp(datetime,c-u-fx,yyyy/MM/dd 18:00:00)","fx"],"desc":{"raw":"计划上线","name":"计划上线"}} -->
    <!--计划上线 日期控件 -->
    <el-form-item prop="prod_deploy_time" label="计划上线" label-width="100px" label-position="right">
      <el-date-picker style="width: 100%" v-model="form_aaabq.prod_deploy_time" clearable type="datetime"
        placeholder="请选择计划上线" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" 
         :default-time="new Date($theia.str.dateFormat(new Date(),'yyyy/MM/dd 18:00:00'))"/>
    </el-form-item>
    </el-col>
    </el-row>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="hide_aaabq" icon="close">取消</el-button>
        <el-button type="primary" @click="save_aaabq" icon="select">提交</el-button>
      </span>
    </template>
    </el-dialog>
   
    <!-- 状态变更 -->
    <el-dialog v-model="conf.aaabr_visible" 
        draggable
      title="状态变更" :close-on-click-modal="false"  width="60%"
      top="10vh" 
      :before-close="hide_aaabr">
    <el-form  ref="fm_aaabr" :model="form_aaabr" :rules="rules_aaabr">
    <el-row>
    <el-col :span="12">
    <!-- {"index":14,"raw":"pmstatus","name":"pmstatus","cname":"Pmstatus","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":false,"constraints":["c","l","le","q","u","v","w","sl","tp(multiselect,q)","fq","tp(radio,c-u-w-fx)","color","lw(80)","fx"],"desc":{"raw":"项目状态","name":"项目状态"}} -->
    <el-form-item prop="pmstatus" label="项目状态" label-width="100px" label-position="right">
      <el-radio-group v-model="form_aaabr.pmstatus"   >
        <el-radio-button v-for="item in pmstatusList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    <el-col :span="12">
    <!-- {"index":15,"raw":"dstatus","name":"dstatus","cname":"Dstatus","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":false,"constraints":["c","l","le","u","v","w","sl","tp(radio,c-u-w-fx)","fq","tp(multiselect,q)","tp(tag)","color","fx"],"desc":{"raw":"研发状态","name":"研发状态"}} -->
    <el-form-item prop="dstatus" label="研发状态" label-width="100px" label-position="right">
      <el-radio-group v-model="form_aaabr.dstatus"   >
        <el-radio-button v-for="item in dstatusList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    </el-row>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="hide_aaabr" icon="close">取消</el-button>
        <el-button type="primary" @click="save_aaabr" icon="select">提交</el-button>
      </span>
    </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data(){
    return{
      conf:{
        aaaku_visible:false,//关联需求
        aaabq_visible:false,//计划时间
        aaabr_visible:false,//状态变更
      },
      form_aaaku:{},//关联需求
      form_aaabq:{},//计划时间
      form_aaabr:{},//状态变更
      //关联需求
      rules_aaaku:{
      },
      //计划时间
      rules_aaabq:{ 
        pmstatus:[{required:true, message:"请输入项目状态", trigger: 'blur'}], 
        dstatus:[{required:true, message:"请输入研发状态", trigger: 'blur'}], 
        req_ass_time:[{required:false, message:"请输入需求评估", trigger: 'blur'}], 
        tch_sol_ass_time:[{required:false, message:"请输入方案评审", trigger: 'blur'}], 
        test_case_time:[{required:false, message:"请输入用例评审", trigger: 'blur'}], 
        join_test_time:[{required:false, message:"请输入联调开始", trigger: 'blur'}], 
        checkin_test_time:[{required:false, message:"请输入提测截止", trigger: 'blur'}], 
        complete_test_time:[{required:false, message:"请输入测试完成", trigger: 'blur'}], 
        prod_deploy_time:[{required:false, message:"请输入计划上线", trigger: 'blur'}],
      },
      //状态变更
      rules_aaabr:{ 
        pmstatus:[{required:true, message:"请输入项目状态", trigger: 'blur'}], 
        dstatus:[{required:true, message:"请输入研发状态", trigger: 'blur'}],
      },
    }
  },
  methods:{
     //--------------------关联需求---------------------------------
      //显示 关联需求 弹出框
      show_aaaku(fm){
        //处理输入参数
        let currentForm = {}
        currentForm.plan_id = fm.plan_id
        Object.assign(this.form_aaaku,currentForm)
        this.form_aaaku.plan_id = fm.plan_id
        this.form_aaaku.pr_id = fm.pr_id
        this.form_aaaku.pr_id = fm.pr_id
        //特殊参数处理
        this.form_aaaku.content = ""
        this.form_aaaku.name = ""
        this.form_aaaku.prstatus = "88"
        this.form_aaaku.source = ""
        this.loadEnums_aaaku()
        this.conf.aaaku_visible = true;
      },

      //隐藏 关联需求 弹出框
      hide_aaaku(){
        this.conf.aaaku_visible = false;
        this.$refs.fm_aaaku.resetFields();
      },

      //保存 关联需求 弹出框数据
      save_aaaku(){
        let that = this
        this.$refs.fm_aaaku.validate((v=>{
          if(!v) return
          let post_form_aaaku = this.form_aaaku
          this.$theia.http.post("/ws/dev/plan/relatepp",post_form_aaaku).then(res=>{
            that.$notify.success({title: '成功',message: '提交成功',duration:5000})
            that.$emit("onsaved")
            that.hide_aaaku()
            that.$theia.enum.clear("active_prod_requirement")
          }).catch(res=>{
            let code = ((res||{}).response||{}).status||0
            let msg= `提交失败(${code})`
            that.$notify.error({title: '失败',message:msg,duration:5000})
          })
      }))
    },
     //--------------------计划时间---------------------------------
      //显示 计划时间 弹出框
      show_aaabq(fm){
        //处理输入参数
        let currentForm = {}
        Object.assign(this.form_aaabq,currentForm)
        this.form_aaabq.pmstatus = fm.pmstatus
        this.form_aaabq.dstatus = fm.dstatus
        this.form_aaabq.req_ass_time = fm.req_ass_time
        this.form_aaabq.tch_sol_ass_time = fm.tch_sol_ass_time
        this.form_aaabq.test_case_time = fm.test_case_time
        this.form_aaabq.join_test_time = fm.join_test_time
        this.form_aaabq.checkin_test_time = fm.checkin_test_time
        this.form_aaabq.complete_test_time = fm.complete_test_time
        this.form_aaabq.prod_deploy_time = fm.prod_deploy_time
        this.form_aaabq.plan_id = fm.plan_id
        //特殊参数处理
        // this.form_aaabq.plan_id = (this.bcheck||[]).join(",")
        this.loadEnums_aaabq()
        this.conf.aaabq_visible = true;
      },

      //隐藏 计划时间 弹出框
      hide_aaabq(){
        this.conf.aaabq_visible = false;
        this.$refs.fm_aaabq.resetFields();
      },

      //保存 计划时间 弹出框数据
      save_aaabq(){
        let that = this
        this.$refs.fm_aaabq.validate((v=>{
          if(!v) return
          let post_form_aaabq = this.form_aaabq
          this.$theia.http.post("/ws/dev/plan/time",post_form_aaabq).then(res=>{
            that.$notify.success({title: '成功',message: '提交成功',duration:5000})
            that.$emit("onsaved")
            that.hide_aaabq()
          }).catch(res=>{
            let code = ((res||{}).response||{}).status||0
            let msg= `提交失败(${code})`
            that.$notify.error({title: '失败',message:msg,duration:5000})
          })
      }))
    },
     //--------------------状态变更---------------------------------
      //显示 状态变更 弹出框
      show_aaabr(fm){
        //处理输入参数
        let currentForm = {}
        Object.assign(this.form_aaabr,currentForm)
        this.form_aaabr.pmstatus = fm.pmstatus
        this.form_aaabr.dstatus = fm.dstatus
        this.form_aaabr.plan_id = fm.plan_id
        //特殊参数处理
        // this.form_aaabr.plan_id = (this.bcheck||[]).join(",")
        this.loadEnums_aaabr()
        this.conf.aaabr_visible = true;
      },

      //隐藏 状态变更 弹出框
      hide_aaabr(){
        this.conf.aaabr_visible = false;
        this.$refs.fm_aaabr.resetFields();
      },

      //保存 状态变更 弹出框数据
      save_aaabr(){
        let that = this
        this.$refs.fm_aaabr.validate((v=>{
          if(!v) return
          let post_form_aaabr = this.form_aaabr
          this.$theia.http.post("/ws/dev/plan/finish",post_form_aaabr).then(res=>{
            that.$notify.success({title: '成功',message: '提交成功',duration:5000})
            that.$emit("onsaved")
            that.hide_aaabr()
          }).catch(res=>{
            let code = ((res||{}).response||{}).status||0
            let msg= `提交失败(${code})`
            that.$notify.error({title: '失败',message:msg,duration:5000})
          })
      }))
    },
    //关联需求
    loadEnums_aaaku(){
    },

    //计划时间
    loadEnums_aaabq(){
        //项目状态
        this.pmstatusList = this.$theia.enum.get("pmstatus","","" ,false,"")
        //研发状态
        this.dstatusList = this.$theia.enum.get("dstatus","","" ,false,"")
    },

    //状态变更
    loadEnums_aaabr(){
        //项目状态
        this.pmstatusList = this.$theia.enum.get("pmstatus","","" ,false,"")
        //研发状态
        this.dstatusList = this.$theia.enum.get("dstatus","","" ,false,"")
    },

  },
}
</script>
<style scoped>
.form_item_info{
  margin-left: 4px;
  color:#999;
}
.form_item_info:hover{
  cursor: pointer;
  font-weight: 500;
  color:#333;
}
</style>